{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "import pandas as pd\n",
    "from math import comb\n",
    "import pickle\n",
    "import time"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**Parameters**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "v=10\n",
    "lam=.125\n",
    "c=1\n",
    "T=10\n",
    "N=2\n",
    "scale=1000"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "dO=[[draw_outcomes(y,z,FS) for z in range(N+1)] for y in range(N+1)]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**Import Last Period**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 155,
   "metadata": {},
   "outputs": [],
   "source": [
    "period=1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 156,
   "metadata": {},
   "outputs": [],
   "source": [
    "payoffsF=pickle.load(open(\"Alternative_Follower_Payoffs_Period_%s_%s_%s_%s.pkl\"%(period+1,N,v,c),\"rb\"))\n",
    "payoffsL=pickle.load(open(\"Alternative_Leader_Payoffs_Period_%s_%s_%s_%s.pkl\"%(period+1,N,v,c),\"rb\"))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**Intermediate (0 Case)**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 157,
   "metadata": {},
   "outputs": [],
   "source": [
    "com=[[comb(y,z) for z in range(y+1)] for y in range(N+1)]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 158,
   "metadata": {},
   "outputs": [],
   "source": [
    "def f_enterF(pf,y,N):\n",
    "    return (comb(N-2,y)*((pf**y)*(1-pf)**(N-2-y)))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 159,
   "metadata": {},
   "outputs": [],
   "source": [
    "def f_enterL(pf,y,N):\n",
    "    return (comb(N-1,y)*((pf**y)*(1-pf)**(N-1-y)))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 160,
   "metadata": {},
   "outputs": [],
   "source": [
    "def pay(payoffs,x):\n",
    "#     print(int(round((scale)*(1-np.exp(-.125*x)))))\n",
    "    return payoffs[x]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 161,
   "metadata": {},
   "outputs": [],
   "source": [
    "def dFx(dexp,x):\n",
    "    return dexp*(((x-FS)/(1-FS))**(dexp-1))*((1)/(1-FS))*.001"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 162,
   "metadata": {},
   "outputs": [],
   "source": [
    "def integral0(payoffs,dexp):\n",
    "    return sum([pay(payoffs,i)*dFx(dexp,i*.001) for i in range(0,1001)])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 163,
   "metadata": {},
   "outputs": [],
   "source": [
    "def intermediate_period_0(payoffsL,payoffsF,initial):\n",
    "    \n",
    "    p=initial[0]\n",
    "    old=5\n",
    "    \n",
    "    epsilon=.001\n",
    "    \n",
    "    j=0\n",
    "    \n",
    "\n",
    "        \n",
    "    while ((abs(p-old))>1e-6):\n",
    "        \n",
    "\n",
    "        \n",
    "        vDraw1=sum([f_enterL(p,y,N)*((1/(y+1))*integralsL[y]) for y in range(N)])\n",
    "        vDraw2=sum([f_enterL(p,y,N)*((y)/(y+1))*integralsF[y] for y in range(1,N)])\n",
    "        \n",
    "        vDraw=vDraw1+vDraw2-c\n",
    "        \n",
    "        vNoDraw=payoffsL[0]*((1-p)**(N-1)) + sum([f_enterL(p,y,N)*integralsF[y-1] for y in range(1,N)])\n",
    "        \n",
    "        old=p\n",
    "\n",
    "        #Gets too big, have to adjust for this\n",
    "        pnew=(np.exp(mu*(vDraw-max(vDraw,vNoDraw))))/(np.exp(mu*(vDraw-max(vDraw,vNoDraw)))+np.exp(mu*(vNoDraw-max(vDraw,vNoDraw))))\n",
    "    \n",
    "        p=(1-epsilon)*old+epsilon*pnew\n",
    "    \n",
    "#         print(p,vDraw,vNoDraw)\n",
    "    \n",
    "    payoff=p*vDraw + (1-p)*vNoDraw\n",
    "#     print(p,vDraw,vNoDraw)\n",
    "    return p,payoff        "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 164,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.0 0.9990014993454456 0.9990014993454456\n"
     ]
    }
   ],
   "source": [
    "epsilonMu=1\n",
    "leader_probs=[]\n",
    "follower_probs=[]\n",
    "leader_payoffs=[]\n",
    "follower_payoffs=[]\n",
    "\n",
    "FS=0\n",
    "\n",
    "prob=.5\n",
    "scale=1000\n",
    "\n",
    "mu=1000\n",
    "\n",
    "integralsL=[integral0(payoffsL,y+1) for y in range(N)]\n",
    "integralsF=[integral0(payoffsF,y) for y in range(1,N+1)]\n",
    "\n",
    "[prob,payoff]=intermediate_period_0(payoffsL,payoffsF,[prob])\n",
    "#         print(mu)\n",
    "leader_probs.append(prob)\n",
    "follower_probs.append(prob)\n",
    "leader_payoffs.append(payoff)\n",
    "follower_payoffs.append(payoff)\n",
    "print(.0005*FS,prob,prob)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**Intermediate (>0 Case)**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 165,
   "metadata": {},
   "outputs": [],
   "source": [
    "def inverse_CDF(FS):\n",
    "    return -np.log(1-FS)/.125"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 166,
   "metadata": {},
   "outputs": [],
   "source": [
    "def draw_outcomes(exp1,exp2,FS):\n",
    "    return ((1-FS)**exp1)*(FS**exp2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 167,
   "metadata": {},
   "outputs": [],
   "source": [
    "def integral(payoffs,dexp,FS):\n",
    "    \n",
    "    if dexp==0:\n",
    "        return 0\n",
    "    else:\n",
    "        return sum([pay(payoffs,i)*dFx(dexp,i*.001) for i in range(int(round(FS*scale)),1001)])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 168,
   "metadata": {},
   "outputs": [],
   "source": [
    "def intermediate_period(FS,payoffsL,payoffsF,initial):\n",
    "    \n",
    "    \n",
    "    pl=initial[0]\n",
    "    pf=initial[1]\n",
    "\n",
    "    oldl=5\n",
    "    oldf=5\n",
    "    \n",
    "    epsilon=.01\n",
    "    \n",
    "    #Follower\n",
    "    j=0\n",
    "    \n",
    "\n",
    "    iteration=0\n",
    "    epsilon=1\n",
    "    while ((abs(pl-oldl)+abs(pf-oldf))>1e-6)&(iteration<6):\n",
    "    \n",
    "\n",
    "    \n",
    "        vFollowerDraw1=payoffsF[round(FS*scale)]*((1-pl)*FS+pl*(FS**2))*sum([f_enterF(pf,y,N)*(FS**y) for y in range(N-1)])\n",
    "        vFollowerDraw2=(1-pl)*sum([f_enterF(pf,y,N)*sum([com[y][z]*integralsF[z]*draw_outcomes(z,y+1-z,FS) for z in range(1,y+1)]) for y in range(1,N-1)])\n",
    "        vFollowerDraw3=(1-pl)*sum([f_enterF(pf,y,N)*sum([(z/(z+1))*com[y][z]*integralsF[z+1]*draw_outcomes(z+1,y-z,FS) for z in range(1,y+1)]) for y in range(1,N-1)])\n",
    "        vFollowerDraw4=pl*sum([f_enterF(pf,y,N)*sum([com[y][z]*integralsF[z]*draw_outcomes(z,y+2-z,FS) for z in range(1,y+1)]) for y in range(1,N-1)])\n",
    "        vFollowerDraw5=pl*sum([f_enterF(pf,y,N)*sum([com[y][z]*integralsF[z+1]*draw_outcomes(z+1,y+1-z,FS) for z in range(y+1)]) for y in range(N-1)])\n",
    "        vFollowerDraw6=pl*sum([f_enterF(pf,y,N)*sum([(z/(z+1))*com[y][z]*integralsF[z+1]*draw_outcomes(z+1,y+1-z,FS) for z in range(1,y+1)]) for y in range(1,N-1)])\n",
    "        vFollowerDraw7=pl*sum([f_enterF(pf,y,N)*sum([((z+1)/(z+2))*com[y][z]*integralsF[z+2]*draw_outcomes(z+2,y-z,FS) for z in range(y+1)]) for y in range(N-1)])\n",
    "        vFollowerDraw8=(1-pl)*sum([f_enterF(pf,y,N)*sum([(1/(z+1))*com[y][z]*integralsL[z+1]*draw_outcomes(z+1,y-z,FS) for z in range(y+1)]) for y in range(N-1)])       \n",
    "        vFollowerDraw9=pl*sum([f_enterF(pf,y,N)*sum([(1/(z+1))*com[y][z]*integralsL[z+1]*draw_outcomes(z+1,y+1-z,FS) for z in range(y+1)]) for y in range(N-1)])\n",
    "        vFollowerDraw10=pl*sum([f_enterF(pf,y,N)*sum([(1/(z+2))*com[y][z]*integralsL[z+2]*draw_outcomes(z+2,y-z,FS) for z in range(y+1)]) for y in range(N-1)])\n",
    "\n",
    "        vFollowerDraw=vFollowerDraw1+vFollowerDraw2+vFollowerDraw3+vFollowerDraw4+vFollowerDraw5\n",
    "        vFollowerDraw=vFollowerDraw + vFollowerDraw6+vFollowerDraw7+vFollowerDraw8+vFollowerDraw9+vFollowerDraw10\n",
    "        vFollowerDraw=vFollowerDraw-c\n",
    "\n",
    "        vFollowerNoDraw1=payoffsF[round(FS*(scale))]*((1-pl)+pl*FS)*sum([f_enterF(pf,y,N)*(FS**y) for y in range(N-1)])\n",
    "        vFollowerNoDraw2=(1-pl)*sum([f_enterF(pf,y,N)*sum([com[y][z]*integralsF[z]*draw_outcomes(z,y-z,FS) for z in range(1,y+1)]) for y in range(1,N-1)])\n",
    "        vFollowerNoDraw3=(pl)*sum([f_enterF(pf,y,N)*sum([com[y][z]*integralsF[z]*draw_outcomes(z,y+1-z,FS) for z in range(1,y+1)]) for y in range(1,N-1)])\n",
    "        vFollowerNoDraw4=pl*sum([f_enterF(pf,y,N)*sum([com[y][z]*integralsF[z+1]*draw_outcomes(z+1,y-z,FS) for z in range(y+1)]) for y in range(N-1)])\n",
    "\n",
    "        vFollowerNoDraw=vFollowerNoDraw1+vFollowerNoDraw2+vFollowerNoDraw3+vFollowerNoDraw4\n",
    "\n",
    "        vLeaderDraw1=payoffsL[round(FS*(scale))]*sum([f_enterL(pf,y,N)*(FS**(y+1)) for y in range(N)])\n",
    "        vLeaderDraw2=sum([f_enterL(pf,y,N)*sum([com[y][z]*integralsF[z]*draw_outcomes(z,y+1-z,FS) for z in range(1,y+1)]) for y in range(1,N)])\n",
    "        vLeaderDraw3=sum([f_enterL(pf,y,N)*sum([(z/(z+1))*com[y][z]*integralsF[z+1]*draw_outcomes(z+1,y-z,FS) for z in range(1,y+1)]) for y in range(1,N)])\n",
    "        vLeaderDraw4=sum([f_enterL(pf,y,N)*sum([(1/(z+1))*com[y][z]*integralsL[z+1]*draw_outcomes(z+1,y-z,FS) for z in range(y+1)]) for y in range(N)])\n",
    "\n",
    "        vLeaderDraw=vLeaderDraw1+vLeaderDraw2+vLeaderDraw3+vLeaderDraw4-c\n",
    "\n",
    "        vLeaderNoDraw1=payoffsL[round(FS*(scale))]*sum([f_enterL(pf,y,N)*(FS**y) for y in range(N)])\n",
    "        vLeaderNoDraw2=sum([f_enterL(pf,y,N)*sum([com[y][z]*integralsF[z]*draw_outcomes(z,y-z,FS) for z in range(1,y+1)]) for y in range(1,N)])\n",
    "        vLeaderNoDraw=vLeaderNoDraw1+vLeaderNoDraw2\n",
    "\n",
    "        oldl=pl\n",
    "        oldf=pf\n",
    "        \n",
    "        pfU=(np.exp(mu*(vFollowerDraw-max(vFollowerDraw,vFollowerNoDraw))))/(np.exp(mu*(vFollowerDraw-max(vFollowerDraw,vFollowerNoDraw)))+np.exp(mu*(vFollowerNoDraw-max(vFollowerDraw,vFollowerNoDraw))))  \n",
    "        plU=(np.exp(mu*(vLeaderDraw-max(vLeaderDraw,vLeaderNoDraw))))/(np.exp(mu*(vLeaderDraw-max(vLeaderDraw,vLeaderNoDraw)))+np.exp(mu*(vLeaderNoDraw-max(vLeaderDraw,vLeaderNoDraw))))\n",
    "\n",
    "        pl=(1-epsilon)*oldl + epsilon*plU\n",
    "        pf=(1-epsilon)*oldf + epsilon*pfU\n",
    "        iteration=iteration+1\n",
    "        \n",
    "    epsilon=.01\n",
    "    \n",
    "    while ((abs(pl-oldl)+abs(pf-oldf))>1e-6):\n",
    "    \n",
    "\n",
    "    \n",
    "        vFollowerDraw1=payoffsF[round(FS*scale)]*((1-pl)*FS+pl*(FS**2))*sum([f_enterF(pf,y,N)*(FS**y) for y in range(N-1)])\n",
    "        vFollowerDraw2=(1-pl)*sum([f_enterF(pf,y,N)*sum([com[y][z]*integralsF[z]*draw_outcomes(z,y+1-z,FS) for z in range(1,y+1)]) for y in range(1,N-1)])\n",
    "        vFollowerDraw3=(1-pl)*sum([f_enterF(pf,y,N)*sum([(z/(z+1))*com[y][z]*integralsF[z+1]*draw_outcomes(z+1,y-z,FS) for z in range(1,y+1)]) for y in range(1,N-1)])\n",
    "        vFollowerDraw4=pl*sum([f_enterF(pf,y,N)*sum([com[y][z]*integralsF[z]*draw_outcomes(z,y+2-z,FS) for z in range(1,y+1)]) for y in range(1,N-1)])\n",
    "        vFollowerDraw5=pl*sum([f_enterF(pf,y,N)*sum([com[y][z]*integralsF[z+1]*draw_outcomes(z+1,y+1-z,FS) for z in range(y+1)]) for y in range(N-1)])\n",
    "        vFollowerDraw6=pl*sum([f_enterF(pf,y,N)*sum([(z/(z+1))*com[y][z]*integralsF[z+1]*draw_outcomes(z+1,y+1-z,FS) for z in range(1,y+1)]) for y in range(N-1)])\n",
    "        vFollowerDraw7=pl*sum([f_enterF(pf,y,N)*sum([((z+1)/(z+2))*com[y][z]*integralsF[z+2]*draw_outcomes(z+2,y-z,FS) for z in range(y+1)]) for y in range(N-1)])\n",
    "        vFollowerDraw8=(1-pl)*sum([f_enterF(pf,y,N)*sum([(1/(z+1))*com[y][z]*integralsL[z+1]*draw_outcomes(z+1,y-z,FS) for z in range(y+1)]) for y in range(N-1)])\n",
    "        vFollowerDraw9=pl*sum([f_enterF(pf,y,N)*sum([(1/(z+1))*com[y][z]*integralsL[z+1]*draw_outcomes(z+1,y+1-z,FS) for z in range(y+1)]) for y in range(N-1)])\n",
    "        vFollowerDraw10=pl*sum([f_enterF(pf,y,N)*sum([(1/(z+2))*com[y][z]*integralsL[z+2]*draw_outcomes(z+2,y-z,FS) for z in range(y+1)]) for y in range(N-1)])\n",
    "\n",
    "        vFollowerDraw=vFollowerDraw1+vFollowerDraw2+vFollowerDraw3+vFollowerDraw4+vFollowerDraw5\n",
    "        vFollowerDraw=vFollowerDraw + vFollowerDraw6+vFollowerDraw7+vFollowerDraw8+vFollowerDraw9+vFollowerDraw10\n",
    "        vFollowerDraw=vFollowerDraw-c\n",
    "\n",
    "        vFollowerNoDraw1=payoffsF[round(FS*(scale))]*((1-pl)+pl*FS)*sum([f_enterF(pf,y,N)*(FS**y) for y in range(N-1)])\n",
    "        vFollowerNoDraw2=(1-pl)*sum([f_enterF(pf,y,N)*sum([com[y][z]*integralsF[z]*draw_outcomes(z,y-z,FS) for z in range(1,y+1)]) for y in range(1,N-1)])\n",
    "        vFollowerNoDraw3=(pl)*sum([f_enterF(pf,y,N)*sum([com[y][z]*integralsF[z]*draw_outcomes(z,y+1-z,FS) for z in range(1,y+1)]) for y in range(1,N-1)])\n",
    "        vFollowerNoDraw4=pl*sum([f_enterF(pf,y,N)*sum([com[y][z]*integralsF[z+1]*draw_outcomes(z+1,y-z,FS) for z in range(y+1)]) for y in range(N-1)])\n",
    "\n",
    "        vFollowerNoDraw=vFollowerNoDraw1+vFollowerNoDraw2+vFollowerNoDraw3+vFollowerNoDraw4\n",
    "\n",
    "        vLeaderDraw1=payoffsL[round(FS*(scale))]*sum([f_enterL(pf,y,N)*(FS**(y+1)) for y in range(N)])\n",
    "        vLeaderDraw2=sum([f_enterL(pf,y,N)*sum([com[y][z]*integralsF[z]*draw_outcomes(z,y+1-z,FS) for z in range(1,y+1)]) for y in range(1,N)])\n",
    "        vLeaderDraw3=sum([f_enterL(pf,y,N)*sum([(z/(z+1))*com[y][z]*integralsF[z+1]*draw_outcomes(z+1,y-z,FS) for z in range(1,y+1)]) for y in range(1,N)])\n",
    "        vLeaderDraw4=sum([f_enterL(pf,y,N)*sum([(1/(z+1))*com[y][z]*integralsL[z+1]*draw_outcomes(z+1,y-z,FS) for z in range(y+1)]) for y in range(N)])\n",
    "\n",
    "        vLeaderDraw=vLeaderDraw1+vLeaderDraw2+vLeaderDraw3+vLeaderDraw4-c\n",
    "\n",
    "        vLeaderNoDraw1=payoffsL[round(FS*(scale))]*sum([f_enterL(pf,y,N)*(FS**y) for y in range(N)])\n",
    "        vLeaderNoDraw2=sum([f_enterL(pf,y,N)*sum([com[y][z]*integralsF[z]*draw_outcomes(z,y-z,FS) for z in range(1,y+1)]) for y in range(1,N)])\n",
    "        vLeaderNoDraw=vLeaderNoDraw1+vLeaderNoDraw2\n",
    "\n",
    "        oldl=pl\n",
    "        oldf=pf\n",
    "        \n",
    "        pfU=(np.exp(mu*(vFollowerDraw-max(vFollowerDraw,vFollowerNoDraw))))/(np.exp(mu*(vFollowerDraw-max(vFollowerDraw,vFollowerNoDraw)))+np.exp(mu*(vFollowerNoDraw-max(vFollowerDraw,vFollowerNoDraw))))  \n",
    "        plU=(np.exp(mu*(vLeaderDraw-max(vLeaderDraw,vLeaderNoDraw))))/(np.exp(mu*(vLeaderDraw-max(vLeaderDraw,vLeaderNoDraw)))+np.exp(mu*(vLeaderNoDraw-max(vLeaderDraw,vLeaderNoDraw))))\n",
    "\n",
    "        pl=(1-epsilon)*oldl + epsilon*plU\n",
    "        pf=(1-epsilon)*oldf + epsilon*pfU\n",
    "        iteration=iteration+1    \n",
    "        \n",
    "#         print(pl,pf,(abs(pl-oldl)+abs(pf-oldf)))\n",
    "        \n",
    "    payoffF=pf*vFollowerDraw + (1-pf)*vFollowerNoDraw\n",
    "    payoffL=pl*vLeaderDraw + (1-pl)*vLeaderNoDraw\n",
    "    \n",
    "    return pl,pf,payoffL,payoffF"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 169,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.001 0.9999999999935707 0.9999999999935707\n",
      "0.002 0.9999999999935825 0.9999999999935825\n",
      "0.003 0.9999999999935945 0.9999999999935945\n",
      "0.004 0.9999999999936062 0.9999999999936062\n",
      "0.005 0.999999999993618 0.999999999993618\n",
      "0.006 0.9999999999936298 0.9999999999936298\n",
      "0.007 0.9999999999936415 0.9999999999936415\n",
      "0.008 0.9999999999936533 0.9999999999936533\n",
      "0.009 0.9999999999936651 0.9999999999936651\n",
      "0.01 0.9999999999936766 0.9999999999936766\n",
      "0.011 0.9999999999936882 0.9999999999936882\n",
      "0.012 0.9999999999936999 0.9999999999936999\n",
      "0.013 0.9999999999937115 0.9999999999937115\n",
      "0.014 0.9999999999937228 0.9999999999937228\n",
      "0.015 0.9999999999937343 0.9999999999937343\n",
      "0.016 0.9999999999937459 0.9999999999937459\n",
      "0.017 0.9999999999937572 0.9999999999937572\n",
      "0.018 0.9999999999937685 0.9999999999937685\n",
      "0.019 0.9999999999937801 0.9999999999937801\n",
      "0.02 0.9999999999937914 0.9999999999937914\n",
      "0.021 0.9999999999938025 0.9999999999938025\n",
      "0.022 0.9999999999938138 0.9999999999938138\n",
      "0.023 0.9999999999938252 0.9999999999938252\n",
      "0.024 0.9999999999938363 0.9999999999938363\n",
      "0.025 0.9999999999938474 0.9999999999938474\n",
      "0.026 0.9999999999938587 0.9999999999938587\n",
      "0.027 0.9999999999938698 0.9999999999938698\n",
      "0.028 0.9999999999938807 0.9999999999938807\n",
      "0.029 0.9999999999938918 0.9999999999938918\n",
      "0.03 0.9999999999939029 0.9999999999939029\n",
      "0.031 0.9999999999939138 0.9999999999939138\n",
      "0.032 0.9999999999939246 0.9999999999939246\n",
      "0.033 0.9999999999939357 0.9999999999939357\n",
      "0.034 0.9999999999939466 0.9999999999939466\n",
      "0.035 0.9999999999939573 0.9999999999939573\n",
      "0.036 0.9999999999939682 0.9999999999939682\n",
      "0.037 0.999999999993979 0.999999999993979\n",
      "0.038 0.9999999999939897 0.9999999999939897\n",
      "0.039 0.9999999999940006 0.9999999999940006\n",
      "0.04 0.9999999999940112 0.9999999999940112\n",
      "0.041 0.9999999999940219 0.9999999999940219\n",
      "0.042 0.9999999999940326 0.9999999999940326\n",
      "0.043 0.9999999999940432 0.9999999999940432\n",
      "0.044 0.9999999999940536 0.9999999999940536\n",
      "0.045 0.9999999999940643 0.9999999999940643\n",
      "0.046 0.9999999999940747 0.9999999999940747\n",
      "0.047 0.9999999999940854 0.9999999999940854\n",
      "0.048 0.9999999999940958 0.9999999999940958\n",
      "0.049 0.9999999999941063 0.9999999999941063\n",
      "0.05 0.9999999999941167 0.9999999999941167\n",
      "0.051 0.9999999999941269 0.9999999999941269\n",
      "0.052 0.9999999999941374 0.9999999999941374\n",
      "0.053 0.9999999999941478 0.9999999999941478\n",
      "0.054 0.999999999994158 0.999999999994158\n",
      "0.055 0.9999999999941682 0.9999999999941682\n",
      "0.056 0.9999999999941784 0.9999999999941784\n",
      "0.057 0.9999999999941886 0.9999999999941886\n",
      "0.058 0.9999999999941989 0.9999999999941989\n",
      "0.059 0.9999999999942091 0.9999999999942091\n",
      "0.06 0.9999999999942193 0.9999999999942193\n",
      "0.061 0.9999999999942293 0.9999999999942293\n",
      "0.062 0.9999999999942395 0.9999999999942395\n",
      "0.063 0.9999999999942495 0.9999999999942495\n",
      "0.064 0.9999999999942595 0.9999999999942595\n",
      "0.065 0.9999999999942695 0.9999999999942695\n",
      "0.066 0.9999999999942795 0.9999999999942795\n",
      "0.067 0.9999999999942895 0.9999999999942895\n",
      "0.068 0.9999999999942992 0.9999999999942992\n",
      "0.069 0.9999999999943092 0.9999999999943092\n",
      "0.07 0.999999999994319 0.999999999994319\n",
      "0.071 0.999999999994329 0.999999999994329\n",
      "0.072 0.9999999999943388 0.9999999999943388\n",
      "0.073 0.9999999999943485 0.9999999999943485\n",
      "0.074 0.9999999999943583 0.9999999999943583\n",
      "0.075 0.9999999999943681 0.9999999999943681\n",
      "0.076 0.9999999999943776 0.9999999999943776\n",
      "0.077 0.9999999999943874 0.9999999999943874\n",
      "0.078 0.9999999999943969 0.9999999999943969\n",
      "0.079 0.9999999999944067 0.9999999999944067\n",
      "0.08 0.9999999999944162 0.9999999999944162\n",
      "0.081 0.9999999999944258 0.9999999999944258\n",
      "0.082 0.9999999999944353 0.9999999999944353\n",
      "0.083 0.9999999999944449 0.9999999999944449\n",
      "0.084 0.9999999999944544 0.9999999999944544\n",
      "0.085 0.9999999999944638 0.9999999999944638\n",
      "0.086 0.9999999999944733 0.9999999999944733\n",
      "0.087 0.9999999999944826 0.9999999999944826\n",
      "0.088 0.9999999999944922 0.9999999999944922\n",
      "0.089 0.9999999999945015 0.9999999999945015\n",
      "0.09 0.9999999999945108 0.9999999999945108\n",
      "0.091 0.9999999999945202 0.9999999999945202\n",
      "0.092 0.9999999999945295 0.9999999999945295\n",
      "0.093 0.9999999999945388 0.9999999999945388\n",
      "0.094 0.9999999999945479 0.9999999999945479\n",
      "0.095 0.9999999999945572 0.9999999999945572\n",
      "0.096 0.9999999999945663 0.9999999999945663\n",
      "0.097 0.9999999999945757 0.9999999999945757\n",
      "0.098 0.9999999999945848 0.9999999999945848\n",
      "0.099 0.9999999999945939 0.9999999999945939\n",
      "0.1 0.999999999994603 0.999999999994603\n",
      "0.101 0.9999999999946121 0.9999999999946121\n",
      "0.102 0.9999999999946212 0.9999999999946212\n",
      "0.103 0.9999999999946301 0.9999999999946301\n",
      "0.104 0.9999999999946392 0.9999999999946392\n",
      "0.105 0.9999999999946483 0.9999999999946483\n",
      "0.106 0.9999999999946572 0.9999999999946572\n",
      "0.107 0.999999999994666 0.999999999994666\n",
      "0.108 0.9999999999946749 0.9999999999946749\n",
      "0.109 0.9999999999946838 0.9999999999946838\n",
      "0.11 0.9999999999946927 0.9999999999946927\n",
      "0.111 0.9999999999947016 0.9999999999947016\n",
      "0.112 0.9999999999947105 0.9999999999947105\n",
      "0.113 0.9999999999947193 0.9999999999947193\n",
      "0.114 0.999999999994728 0.999999999994728\n",
      "0.115 0.9999999999947369 0.9999999999947369\n",
      "0.116 0.9999999999947455 0.9999999999947455\n",
      "0.117 0.9999999999947542 0.9999999999947542\n",
      "0.118 0.9999999999947629 0.9999999999947629\n",
      "0.119 0.9999999999947715 0.9999999999947715\n",
      "0.12 0.9999999999947802 0.9999999999947802\n",
      "0.121 0.9999999999947888 0.9999999999947888\n",
      "0.122 0.9999999999947975 0.9999999999947975\n",
      "0.123 0.9999999999948059 0.9999999999948059\n",
      "0.124 0.9999999999948146 0.9999999999948146\n",
      "0.125 0.999999999994823 0.999999999994823\n",
      "0.126 0.9999999999948317 0.9999999999948317\n",
      "0.127 0.9999999999948401 0.9999999999948401\n",
      "0.128 0.9999999999948486 0.9999999999948486\n",
      "0.129 0.999999999994857 0.999999999994857\n",
      "0.13 0.9999999999948654 0.9999999999948654\n",
      "0.131 0.9999999999948739 0.9999999999948739\n",
      "0.132 0.9999999999948823 0.9999999999948823\n",
      "0.133 0.9999999999948905 0.9999999999948905\n",
      "0.134 0.999999999994899 0.999999999994899\n",
      "0.135 0.9999999999949072 0.9999999999949072\n",
      "0.136 0.9999999999949156 0.9999999999949156\n",
      "0.137 0.9999999999949238 0.9999999999949238\n",
      "0.138 0.999999999994932 0.999999999994932\n",
      "0.139 0.9999999999949403 0.9999999999949403\n",
      "0.14 0.9999999999949485 0.9999999999949485\n",
      "0.141 0.9999999999949567 0.9999999999949567\n",
      "0.142 0.9999999999949649 0.9999999999949649\n",
      "0.143 0.9999999999949731 0.9999999999949731\n",
      "0.144 0.9999999999949811 0.9999999999949811\n",
      "0.145 0.9999999999949893 0.9999999999949893\n",
      "0.146 0.9999999999949973 0.9999999999949973\n",
      "0.147 0.9999999999950056 0.9999999999950056\n",
      "0.148 0.9999999999950135 0.9999999999950135\n",
      "0.149 0.9999999999950215 0.9999999999950215\n",
      "0.15 0.9999999999950295 0.9999999999950295\n",
      "0.151 0.9999999999950375 0.9999999999950375\n",
      "0.152 0.9999999999950455 0.9999999999950455\n",
      "0.153 0.9999999999950535 0.9999999999950535\n",
      "0.154 0.9999999999950615 0.9999999999950615\n",
      "0.155 0.9999999999950693 0.9999999999950693\n",
      "0.156 0.9999999999950773 0.9999999999950773\n",
      "0.157 0.999999999995085 0.999999999995085\n",
      "0.158 0.999999999995093 0.999999999995093\n",
      "0.159 0.9999999999951008 0.9999999999951008\n",
      "0.16 0.9999999999951086 0.9999999999951086\n",
      "0.161 0.9999999999951164 0.9999999999951164\n",
      "0.162 0.9999999999951241 0.9999999999951241\n",
      "0.163 0.9999999999951319 0.9999999999951319\n",
      "0.164 0.9999999999951397 0.9999999999951397\n",
      "0.165 0.9999999999951474 0.9999999999951474\n",
      "0.166 0.999999999995155 0.999999999995155\n",
      "0.167 0.9999999999951628 0.9999999999951628\n",
      "0.168 0.9999999999951703 0.9999999999951703\n",
      "0.169 0.9999999999951781 0.9999999999951781\n",
      "0.17 0.9999999999951856 0.9999999999951856\n",
      "0.171 0.9999999999951932 0.9999999999951932\n",
      "0.172 0.999999999995201 0.999999999995201\n",
      "0.173 0.9999999999952085 0.9999999999952085\n",
      "0.174 0.999999999995216 0.999999999995216\n",
      "0.175 0.9999999999952236 0.9999999999952236\n",
      "0.176 0.9999999999952309 0.9999999999952309\n",
      "0.177 0.9999999999952385 0.9999999999952385\n",
      "0.178 0.999999999995246 0.999999999995246\n",
      "0.179 0.9999999999952534 0.9999999999952534\n",
      "0.18 0.9999999999952609 0.9999999999952609\n",
      "0.181 0.9999999999952682 0.9999999999952682\n",
      "0.182 0.9999999999952758 0.9999999999952758\n",
      "0.183 0.9999999999952831 0.9999999999952831\n",
      "0.184 0.9999999999952904 0.9999999999952904\n",
      "0.185 0.9999999999952978 0.9999999999952978\n",
      "0.186 0.9999999999953051 0.9999999999953051\n",
      "0.187 0.9999999999953124 0.9999999999953124\n",
      "0.188 0.9999999999953197 0.9999999999953197\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.189 0.9999999999953271 0.9999999999953271\n",
      "0.19 0.9999999999953342 0.9999999999953342\n",
      "0.191 0.9999999999953415 0.9999999999953415\n",
      "0.192 0.9999999999953486 0.9999999999953486\n",
      "0.193 0.9999999999953559 0.9999999999953559\n",
      "0.194 0.999999999995363 0.999999999995363\n",
      "0.195 0.9999999999953704 0.9999999999953704\n",
      "0.196 0.9999999999953775 0.9999999999953775\n",
      "0.197 0.9999999999953846 0.9999999999953846\n",
      "0.198 0.9999999999953917 0.9999999999953917\n",
      "0.199 0.9999999999953988 0.9999999999953988\n",
      "0.2 0.9999999999954059 0.9999999999954059\n",
      "0.201 0.999999999995413 0.999999999995413\n",
      "0.202 0.9999999999954199 0.9999999999954199\n",
      "0.203 0.999999999995427 0.999999999995427\n",
      "0.204 0.9999999999954341 0.9999999999954341\n",
      "0.205 0.999999999995441 0.999999999995441\n",
      "0.206 0.9999999999954481 0.9999999999954481\n",
      "0.207 0.999999999995455 0.999999999995455\n",
      "0.208 0.9999999999954619 0.9999999999954619\n",
      "0.209 0.999999999995469 0.999999999995469\n",
      "0.21 0.9999999999954758 0.9999999999954758\n",
      "0.211 0.9999999999954827 0.9999999999954827\n",
      "0.212 0.9999999999954896 0.9999999999954896\n",
      "0.213 0.9999999999954965 0.9999999999954965\n",
      "0.214 0.9999999999955034 0.9999999999955034\n",
      "0.215 0.99999999999551 0.99999999999551\n",
      "0.216 0.9999999999955169 0.9999999999955169\n",
      "0.217 0.9999999999955238 0.9999999999955238\n",
      "0.218 0.9999999999955305 0.9999999999955305\n",
      "0.219 0.9999999999955373 0.9999999999955373\n",
      "0.22 0.999999999995544 0.999999999995544\n",
      "0.221 0.9999999999955507 0.9999999999955507\n",
      "0.222 0.9999999999955576 0.9999999999955576\n",
      "0.223 0.9999999999955642 0.9999999999955642\n",
      "0.224 0.9999999999955709 0.9999999999955709\n",
      "0.225 0.9999999999955775 0.9999999999955775\n",
      "0.226 0.9999999999955842 0.9999999999955842\n",
      "0.227 0.9999999999955909 0.9999999999955909\n",
      "0.228 0.9999999999955975 0.9999999999955975\n",
      "0.229 0.9999999999956042 0.9999999999956042\n",
      "0.23 0.9999999999956106 0.9999999999956106\n",
      "0.231 0.9999999999956173 0.9999999999956173\n",
      "0.232 0.999999999995624 0.999999999995624\n",
      "0.233 0.9999999999956304 0.9999999999956304\n",
      "0.234 0.999999999995637 0.999999999995637\n",
      "0.235 0.9999999999956435 0.9999999999956435\n",
      "0.236 0.9999999999956499 0.9999999999956499\n",
      "0.237 0.9999999999956564 0.9999999999956564\n",
      "0.238 0.999999999995663 0.999999999995663\n",
      "0.239 0.9999999999956695 0.9999999999956695\n",
      "0.24 0.9999999999956759 0.9999999999956759\n",
      "0.241 0.9999999999956823 0.9999999999956823\n",
      "0.242 0.9999999999956888 0.9999999999956888\n",
      "0.243 0.999999999995695 0.999999999995695\n",
      "0.244 0.9999999999957014 0.9999999999957014\n",
      "0.245 0.9999999999957079 0.9999999999957079\n",
      "0.246 0.9999999999957141 0.9999999999957141\n",
      "0.247 0.9999999999957205 0.9999999999957205\n",
      "0.248 0.9999999999957268 0.9999999999957268\n",
      "0.249 0.9999999999957332 0.9999999999957332\n",
      "0.25 0.9999999999957394 0.9999999999957394\n",
      "0.251 0.9999999999957458 0.9999999999957458\n",
      "0.252 0.9999999999957521 0.9999999999957521\n",
      "0.253 0.9999999999957583 0.9999999999957583\n",
      "0.254 0.9999999999957645 0.9999999999957645\n",
      "0.255 0.9999999999957707 0.9999999999957707\n",
      "0.256 0.9999999999957769 0.9999999999957769\n",
      "0.257 0.9999999999957832 0.9999999999957832\n",
      "0.258 0.9999999999957894 0.9999999999957894\n",
      "0.259 0.9999999999957956 0.9999999999957956\n",
      "0.26 0.9999999999958016 0.9999999999958016\n",
      "0.261 0.9999999999958078 0.9999999999958078\n",
      "0.262 0.9999999999958138 0.9999999999958138\n",
      "0.263 0.99999999999582 0.99999999999582\n",
      "0.264 0.999999999995826 0.999999999995826\n",
      "0.265 0.9999999999958322 0.9999999999958322\n",
      "0.266 0.9999999999958382 0.9999999999958382\n",
      "0.267 0.9999999999958442 0.9999999999958442\n",
      "0.268 0.9999999999958504 0.9999999999958504\n",
      "0.269 0.9999999999958564 0.9999999999958564\n",
      "0.27 0.9999999999958624 0.9999999999958624\n",
      "0.271 0.9999999999958684 0.9999999999958684\n",
      "0.272 0.9999999999958744 0.9999999999958744\n",
      "0.273 0.9999999999958804 0.9999999999958804\n",
      "0.274 0.9999999999958864 0.9999999999958864\n",
      "0.275 0.9999999999958922 0.9999999999958922\n",
      "0.276 0.9999999999958982 0.9999999999958982\n",
      "0.277 0.9999999999959042 0.9999999999959042\n",
      "0.278 0.9999999999959099 0.9999999999959099\n",
      "0.279 0.9999999999959159 0.9999999999959159\n",
      "0.28 0.9999999999959217 0.9999999999959217\n",
      "0.281 0.9999999999959277 0.9999999999959277\n",
      "0.282 0.9999999999959335 0.9999999999959335\n",
      "0.283 0.9999999999959392 0.9999999999959392\n",
      "0.284 0.9999999999959452 0.9999999999959452\n",
      "0.285 0.999999999995951 0.999999999995951\n",
      "0.286 0.9999999999959568 0.9999999999959568\n",
      "0.287 0.9999999999959626 0.9999999999959626\n",
      "0.288 0.9999999999959683 0.9999999999959683\n",
      "0.289 0.9999999999959741 0.9999999999959741\n",
      "0.29 0.9999999999959799 0.9999999999959799\n",
      "0.291 0.9999999999959857 0.9999999999959857\n",
      "0.292 0.9999999999959912 0.9999999999959912\n",
      "0.293 0.999999999995997 0.999999999995997\n",
      "0.294 0.9999999999960028 0.9999999999960028\n",
      "0.295 0.9999999999960083 0.9999999999960083\n",
      "0.296 0.9999999999960141 0.9999999999960141\n",
      "0.297 0.9999999999960196 0.9999999999960196\n",
      "0.298 0.9999999999960254 0.9999999999960254\n",
      "0.299 0.999999999996031 0.999999999996031\n",
      "0.3 0.9999999999960367 0.9999999999960367\n",
      "0.301 0.9999999999960423 0.9999999999960423\n",
      "0.302 0.9999999999960478 0.9999999999960478\n",
      "0.303 0.9999999999960534 0.9999999999960534\n",
      "0.304 0.9999999999960589 0.9999999999960589\n",
      "0.305 0.9999999999960645 0.9999999999960645\n",
      "0.306 0.99999999999607 0.99999999999607\n",
      "0.307 0.9999999999960756 0.9999999999960756\n",
      "0.308 0.9999999999960811 0.9999999999960811\n",
      "0.309 0.9999999999960867 0.9999999999960867\n",
      "0.31 0.9999999999960922 0.9999999999960922\n",
      "0.311 0.9999999999960976 0.9999999999960976\n",
      "0.312 0.9999999999961031 0.9999999999961031\n",
      "0.313 0.9999999999961087 0.9999999999961087\n",
      "0.314 0.999999999996114 0.999999999996114\n",
      "0.315 0.9999999999961195 0.9999999999961195\n",
      "0.316 0.9999999999961249 0.9999999999961249\n",
      "0.317 0.9999999999961302 0.9999999999961302\n",
      "0.318 0.9999999999961358 0.9999999999961358\n",
      "0.319 0.9999999999961411 0.9999999999961411\n",
      "0.32 0.9999999999961464 0.9999999999961464\n",
      "0.321 0.9999999999961517 0.9999999999961517\n",
      "0.322 0.9999999999961571 0.9999999999961571\n",
      "0.323 0.9999999999961624 0.9999999999961626\n",
      "0.324 0.999999999996168 0.999999999996168\n",
      "0.325 0.9999999999961731 0.9999999999961733\n",
      "0.326 0.9999999999961784 0.9999999999961784\n",
      "0.327 0.9999999999961837 0.9999999999961837\n",
      "0.328 0.999999999996189 0.999999999996189\n",
      "0.329 0.9999999999961944 0.9999999999961944\n",
      "0.33 0.9999999999961995 0.9999999999961997\n",
      "0.331 0.9999999999962048 0.9999999999962048\n",
      "0.332 0.9999999999962101 0.9999999999962101\n",
      "0.333 0.9999999999962152 0.9999999999962152\n",
      "0.334 0.9999999999962206 0.9999999999962206\n",
      "0.335 0.9999999999962257 0.9999999999962257\n",
      "0.336 0.9999999999962308 0.999999999996231\n",
      "0.337 0.9999999999962361 0.9999999999962361\n",
      "0.338 0.9999999999962412 0.9999999999962412\n",
      "0.339 0.9999999999962463 0.9999999999962463\n",
      "0.34 0.9999999999962517 0.9999999999962517\n",
      "0.341 0.9999999999962568 0.9999999999962568\n",
      "0.342 0.9999999999962619 0.9999999999962619\n",
      "0.343 0.999999999996267 0.999999999996267\n",
      "0.344 0.9999999999962721 0.9999999999962721\n",
      "0.345 0.9999999999962772 0.9999999999962772\n",
      "0.346 0.9999999999962823 0.9999999999962823\n",
      "0.347 0.9999999999962872 0.9999999999962874\n",
      "0.348 0.9999999999962923 0.9999999999962923\n",
      "0.349 0.9999999999962974 0.9999999999962974\n",
      "0.35 0.9999999999963025 0.9999999999963025\n",
      "0.351 0.9999999999963074 0.9999999999963074\n",
      "0.352 0.9999999999963125 0.9999999999963125\n",
      "0.353 0.9999999999963174 0.9999999999963176\n",
      "0.354 0.9999999999963225 0.9999999999963225\n",
      "0.355 0.9999999999963274 0.9999999999963276\n",
      "0.356 0.9999999999963325 0.9999999999963325\n",
      "0.357 0.9999999999963374 0.9999999999963374\n",
      "0.358 0.9999999999963423 0.9999999999963425\n",
      "0.359 0.9999999999963474 0.9999999999963474\n",
      "0.36 0.9999999999963523 0.9999999999963523\n",
      "0.361 0.9999999999963571 0.9999999999963571\n",
      "0.362 0.999999999996362 0.999999999996362\n",
      "0.363 0.9999999999963669 0.9999999999963669\n",
      "0.364 0.9999999999963718 0.9999999999963718\n",
      "0.365 0.9999999999963767 0.9999999999963767\n",
      "0.366 0.9999999999963816 0.9999999999963816\n",
      "0.367 0.9999999999963864 0.9999999999963864\n",
      "0.368 0.9999999999963913 0.9999999999963913\n",
      "0.369 0.999999999996396 0.9999999999963962\n",
      "0.37 0.9999999999964009 0.9999999999964011\n",
      "0.371 0.9999999999964058 0.9999999999964058\n",
      "0.372 0.9999999999964104 0.9999999999964106\n",
      "0.373 0.9999999999964153 0.9999999999964155\n",
      "0.374 0.99999999999642 0.9999999999964202\n",
      "0.375 0.9999999999964249 0.9999999999964251\n",
      "0.376 0.9999999999964295 0.9999999999964297\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.377 0.9999999999964344 0.9999999999964346\n",
      "0.378 0.9999999999964391 0.9999999999964393\n",
      "0.379 0.9999999999964437 0.999999999996444\n",
      "0.38 0.9999999999964486 0.9999999999964488\n",
      "0.381 0.9999999999964533 0.9999999999964535\n",
      "0.382 0.9999999999964579 0.9999999999964582\n",
      "0.383 0.9999999999964626 0.9999999999964628\n",
      "0.384 0.9999999999964673 0.9999999999964677\n",
      "0.385 0.9999999999964719 0.9999999999964724\n",
      "0.386 0.9999999999964766 0.999999999996477\n",
      "0.387 0.9999999999964813 0.9999999999964817\n",
      "0.388 0.9999999999964859 0.9999999999964864\n",
      "0.389 0.9999999999964906 0.999999999996491\n",
      "0.39 0.9999999999964952 0.9999999999964955\n",
      "0.391 0.9999999999964999 0.9999999999965001\n",
      "0.392 0.9999999999965044 0.9999999999965048\n",
      "0.393 0.999999999996509 0.9999999999965095\n",
      "0.394 0.9999999999965137 0.9999999999965139\n",
      "0.395 0.9999999999965181 0.9999999999965186\n",
      "0.396 0.9999999999965228 0.9999999999965232\n",
      "0.397 0.9999999999965272 0.9999999999965277\n",
      "0.398 0.9999999999965319 0.9999999999965323\n",
      "0.399 0.9999999999965363 0.9999999999965368\n",
      "0.4 0.9999999999965408 0.9999999999965414\n",
      "0.401 0.9999999999965454 0.9999999999965459\n",
      "0.402 0.9999999999965499 0.9999999999965505\n",
      "0.403 0.9999999999965543 0.999999999996555\n",
      "0.404 0.9999999999965588 0.9999999999965594\n",
      "0.405 0.9999999999965632 0.9999999999965641\n",
      "0.406 0.9999999999965676 0.9999999999965685\n",
      "0.407 0.9999999999965721 0.999999999996573\n",
      "0.408 0.9999999999965765 0.9999999999965774\n",
      "0.409 0.999999999996581 0.9999999999965818\n",
      "0.41 0.9999999999965854 0.9999999999965863\n",
      "0.411 0.9999999999965898 0.9999999999965907\n",
      "0.412 0.9999999999965943 0.9999999999965952\n",
      "0.413 0.9999999999965987 0.9999999999965996\n",
      "0.414 0.9999999999966029 0.999999999996604\n",
      "0.415 0.9999999999966074 0.9999999999966085\n",
      "0.416 0.9999999999966118 0.9999999999966129\n",
      "0.417 0.999999999996616 0.9999999999966174\n",
      "0.418 0.9999999999966205 0.9999999999966216\n",
      "0.419 0.9999999999966247 0.999999999996626\n",
      "0.42 0.9999999999966291 0.9999999999966305\n",
      "0.421 0.9999999999966334 0.9999999999966347\n",
      "0.422 0.9999999999966378 0.9999999999966391\n",
      "0.423 0.999999999996642 0.9999999999966436\n",
      "0.424 0.9999999999966462 0.9999999999966478\n",
      "0.425 0.9999999999966505 0.9999999999966522\n",
      "0.426 0.9999999999966547 0.9999999999966565\n",
      "0.427 0.9999999999966591 0.9999999999966609\n",
      "0.428 0.9999999999966633 0.9999999999966651\n",
      "0.429 0.9999999999966676 0.9999999999966693\n",
      "0.43 0.9999999999966718 0.9999999999966738\n",
      "0.431 0.999999999996676 0.999999999996678\n",
      "0.432 0.99999999999668 0.9999999999966822\n",
      "0.433 0.9999999999966842 0.9999999999966867\n",
      "0.434 0.9999999999966884 0.9999999999966909\n",
      "0.435 0.9999999999966926 0.9999999999966951\n",
      "0.436 0.9999999999966969 0.9999999999966993\n",
      "0.437 0.9999999999967009 0.9999999999967035\n",
      "0.438 0.9999999999967051 0.9999999999967077\n",
      "0.439 0.9999999999967091 0.9999999999967122\n",
      "0.44 0.9999999999967133 0.9999999999967164\n",
      "0.441 0.9999999999967173 0.9999999999967206\n",
      "0.442 0.9999999999967215 0.9999999999967248\n",
      "0.443 0.9999999999967255 0.9999999999967291\n",
      "0.444 0.9999999999967295 0.9999999999967331\n",
      "0.445 0.9999999999967337 0.9999999999967373\n",
      "0.446 0.9999999999967377 0.9999999999967415\n",
      "0.447 0.9999999999967417 0.9999999999967457\n",
      "0.448 0.9999999999967457 0.9999999999967499\n",
      "0.449 0.9999999999967497 0.9999999999967542\n",
      "0.45 0.9999999999967537 0.9999999999967581\n",
      "0.451 0.9999999999967577 0.9999999999967624\n",
      "0.452 0.9999999999967617 0.9999999999967666\n",
      "0.453 0.9999999999967657 0.9999999999967708\n",
      "0.454 0.9999999999967695 0.9999999999967748\n",
      "0.455 0.9999999999967735 0.999999999996779\n",
      "0.456 0.9999999999967775 0.9999999999967832\n",
      "0.457 0.9999999999967812 0.9999999999967872\n",
      "0.458 0.9999999999967852 0.9999999999967915\n",
      "0.459 0.999999999996789 0.9999999999967955\n",
      "0.46 0.999999999996793 0.9999999999967997\n",
      "0.461 0.9999999999967968 0.9999999999968037\n",
      "0.462 0.9999999999968006 0.9999999999968079\n",
      "0.463 0.9999999999968046 0.9999999999968119\n",
      "0.464 0.9999999999968083 0.9999999999968161\n",
      "0.465 0.9999999999968121 0.9999999999968201\n",
      "0.466 0.9999999999968159 0.9999999999968243\n",
      "0.467 0.9999999999968197 0.9999999999968283\n",
      "0.468 0.9999999999968234 0.9999999999968325\n",
      "0.469 0.9999999999968272 0.9999999999968365\n",
      "0.47 0.999999999996831 0.9999999999968407\n",
      "0.471 0.9999999999968345 0.9999999999968447\n",
      "0.472 0.9999999999968383 0.9999999999968487\n",
      "0.473 0.9999999999968421 0.999999999996853\n",
      "0.474 0.9999999999968456 0.999999999996857\n",
      "0.475 0.9999999999968494 0.999999999996861\n",
      "0.476 0.999999999996853 0.9999999999968652\n",
      "0.477 0.9999999999968565 0.9999999999968692\n",
      "0.478 0.9999999999968601 0.9999999999968734\n",
      "0.479 0.9999999999968638 0.9999999999968774\n",
      "0.48 0.9999999999968674 0.9999999999968814\n",
      "0.481 0.999999999996871 0.9999999999968856\n",
      "0.482 0.9999999999968745 0.9999999999968896\n",
      "0.483 0.9999999999968778 0.9999999999968936\n",
      "0.484 0.9999999999968814 0.9999999999968978\n",
      "0.485 0.9999999999968849 0.9999999999969018\n",
      "0.486 0.9999999999968883 0.9999999999969058\n",
      "0.487 0.9999999999968918 0.99999999999691\n",
      "0.488 0.9999999999968952 0.999999999996914\n",
      "0.489 0.9999999999968987 0.9999999999969182\n",
      "0.49 0.999999999996902 0.9999999999969222\n",
      "0.491 0.9999999999969054 0.9999999999969262\n",
      "0.492 0.9999999999969087 0.9999999999969305\n",
      "0.493 0.999999999996912 0.9999999999969345\n",
      "0.494 0.9999999999969154 0.9999999999969387\n",
      "0.495 0.9999999999969185 0.9999999999969427\n",
      "0.496 0.9999999999969218 0.9999999999969469\n",
      "0.497 0.9999999999969251 0.9999999999969509\n",
      "0.498 0.9999999999969282 0.9999999999969551\n",
      "0.499 0.9999999999969313 0.9999999999969593\n",
      "0.5 0.9999999999969345 0.9999999999969633\n",
      "0.501 0.9999999999969376 0.9999999999969675\n",
      "0.502 0.9999999999969407 0.9999999999969715\n",
      "0.503 0.9999999999969438 0.9999999999969758\n",
      "0.504 0.9999999999969469 0.99999999999698\n",
      "0.505 0.9999999999969498 0.9999999999969842\n",
      "0.506 0.9999999999969529 0.9999999999969884\n",
      "0.507 0.9999999999969558 0.9999999999969924\n",
      "0.508 0.9999999999969587 0.9999999999969966\n",
      "0.509 0.9999999999969615 0.9999999999970008\n",
      "0.51 0.9999999999969644 0.9999999999970051\n",
      "0.511 0.9999999999969673 0.9999999999970095\n",
      "0.512 0.9999999999969702 0.9999999999970137\n",
      "0.513 0.9999999999969729 0.9999999999970179\n",
      "0.514 0.9999999999969755 0.9999999999970222\n",
      "0.515 0.9999999999969784 0.9999999999970264\n",
      "0.516 0.9999999999969811 0.9999999999970308\n",
      "0.517 0.9999999999969835 0.999999999997035\n",
      "0.518 0.9999999999969862 0.9999999999970395\n",
      "0.519 0.9999999999969886 0.9999999999970437\n",
      "0.52 0.9999999999969913 0.9999999999970481\n",
      "0.521 0.9999999999969937 0.9999999999970526\n",
      "0.522 0.9999999999969962 0.999999999997057\n",
      "0.523 0.9999999999969984 0.9999999999970615\n",
      "0.524 0.9999999999970008 0.9999999999970659\n",
      "0.525 0.9999999999970031 0.9999999999970703\n",
      "0.526 0.9999999999970053 0.9999999999970748\n",
      "0.527 0.9999999999970075 0.9999999999970792\n",
      "0.528 0.9999999999970097 0.9999999999970839\n",
      "0.529 0.9999999999970117 0.9999999999970883\n",
      "0.53 0.9999999999970139 0.999999999997093\n",
      "0.531 0.9999999999970159 0.9999999999970977\n",
      "0.532 0.9999999999970177 0.9999999999971023\n",
      "0.533 0.9999999999970197 0.999999999997107\n",
      "0.534 0.9999999999970215 0.9999999999971116\n",
      "0.535 0.9999999999970233 0.9999999999971163\n",
      "0.536 0.999999999997025 0.9999999999971212\n",
      "0.537 0.9999999999970266 0.9999999999971259\n",
      "0.538 0.9999999999970282 0.9999999999971307\n",
      "0.539 0.9999999999970297 0.9999999999971356\n",
      "0.54 0.9999999999970313 0.9999999999971405\n",
      "0.541 0.9999999999970326 0.9999999999971454\n",
      "0.542 0.9999999999970339 0.9999999999971503\n",
      "0.543 0.9999999999970353 0.9999999999971554\n",
      "0.544 0.9999999999970364 0.9999999999971605\n",
      "0.545 0.9999999999970375 0.9999999999971656\n",
      "0.546 0.9999999999970384 0.9999999999971707\n",
      "0.547 0.9999999999970395 0.9999999999971758\n",
      "0.548 0.9999999999970404 0.9999999999971809\n",
      "0.549 0.999999999997041 0.9999999999971863\n",
      "0.55 0.9999999999970417 0.9999999999971916\n",
      "0.551 0.9999999999970424 0.9999999999971969\n",
      "0.552 0.9999999999970428 0.9999999999972009\n",
      "0.553 0.9999999999970433 0.9999999999971698\n",
      "0.554 0.9999999999970439 0.99999999999716\n",
      "0.555 0.9999999999970448 0.9999999999971652\n",
      "0.556 0.9999999999970455 0.9999999999971703\n",
      "0.557 0.9999999999970464 0.9999999999971758\n",
      "0.558 0.9999999999970468 0.9999999999971811\n",
      "0.559 0.9999999999970475 0.9999999999971867\n",
      "0.56 0.9999999999970479 0.9999999999971922\n",
      "0.561 0.9999999999970481 0.9999999999971978\n",
      "0.562 0.9999999999970484 0.9999999999972033\n",
      "0.563 0.9999999999970484 0.9999999999972091\n",
      "0.564 0.9999999999970484 0.9999999999972149\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.565 0.9999999999970481 0.9999999999972209\n",
      "0.566 0.9999999999970479 0.9999999999972267\n",
      "0.567 0.9999999999970475 0.9999999999972327\n",
      "0.568 0.999999999997047 0.9999999999972389\n",
      "0.569 0.9999999999970464 0.9999999999972451\n",
      "0.57 0.9999999999970455 0.9999999999972513\n",
      "0.571 0.9999999999970446 0.9999999999972575\n",
      "0.572 0.9999999999970435 0.999999999997264\n",
      "0.573 0.9999999999970421 0.9999999999972704\n",
      "0.574 0.9999999999970408 0.9999999999972771\n",
      "0.575 0.9999999999970393 0.9999999999972837\n",
      "0.576 0.9999999999970375 0.9999999999972904\n",
      "0.577 0.9999999999970357 0.9999999999972973\n",
      "0.578 0.9999999999970335 0.9999999999973042\n",
      "0.579 0.9999999999970313 0.9999999999973113\n",
      "0.58 0.9999999999970288 0.9999999999973184\n",
      "0.581 0.9999999999970264 0.9999999999973257\n",
      "0.582 0.9999999999970235 0.999999999997333\n",
      "0.583 0.9999999999970204 0.9999999999973403\n",
      "0.584 0.999999999997017 0.9999999999973479\n",
      "0.585 0.9999999999970137 0.9999999999973557\n",
      "0.586 0.99999999999701 0.9999999999973634\n",
      "0.587 0.9999999999970062 0.9999999999973714\n",
      "0.588 0.999999999997002 0.9999999999973794\n",
      "0.589 0.9999999999969975 0.9999999999973874\n",
      "0.59 0.9999999999969928 0.9999999999973956\n",
      "0.591 0.999999999996988 0.9999999999974041\n",
      "0.592 0.9999999999969829 0.9999999999974125\n",
      "0.593 0.9999999999969773 0.9999999999974212\n",
      "0.594 0.9999999999969715 0.9999999999974298\n",
      "0.595 0.9999999999969655 0.9999999999974385\n",
      "0.596 0.9999999999969591 0.9999999999974476\n",
      "0.597 0.9999999999969524 0.9999999999974565\n",
      "0.598 0.9999999999969456 0.9999999999974658\n",
      "0.599 0.9999999999969382 0.9999999999974749\n",
      "0.6 0.9999999999969305 0.9999999999974845\n",
      "0.601 0.9999999999969225 0.9999999999974938\n",
      "0.602 0.999999999996914 0.9999999999975033\n",
      "0.603 0.9999999999969054 0.9999999999975131\n",
      "0.604 0.9999999999968963 0.9999999999975226\n",
      "0.605 0.9999999999968865 0.9999999999975324\n",
      "0.606 0.9999999999968765 0.9999999999975422\n",
      "0.607 0.9999999999968663 0.9999999999975522\n",
      "0.608 0.9999999999968554 0.999999999997562\n",
      "0.609 0.9999999999968441 0.9999999999975715\n",
      "0.61 0.9999999999968323 0.9999999999975813\n",
      "0.611 0.9999999999968201 0.9999999999975908\n",
      "0.612 0.9999999999968072 0.9999999999975999\n",
      "0.613 0.9999999999967939 0.999999999997609\n",
      "0.614 0.9999999999967801 0.9999999999976175\n",
      "0.615 0.9999999999967659 0.9999999999976257\n",
      "0.616 0.999999999996751 0.999999999997633\n",
      "0.617 0.9999999999967357 0.9999999999976394\n",
      "0.618 0.9999999999967197 0.9999999999976448\n",
      "0.619 0.9999999999967031 0.9999999999976488\n",
      "0.62 0.999999999996686 0.999999999997651\n",
      "0.621 0.9999999999966684 0.999999999997651\n",
      "0.622 0.9999999999966502 0.9999999999976479\n",
      "0.623 0.9999999999966314 0.999999999997641\n",
      "0.624 0.999999999996612 0.9999999999976206\n",
      "0.625 0.9999999999965923 0.999999999997359\n",
      "0.626 0.999999999996561 0.9999999999967895\n",
      "0.627 0.999999999996541 0.9999999999966989\n",
      "0.628 0.9999999999965223 0.9999999999966414\n",
      "0.629 0.9999999999964988 0.9999999999965687\n",
      "0.63 0.9999999999964644 0.9999999999964762\n",
      "0.631 0.9999999999964033 0.9999999999963605\n",
      "0.632 0.9999999999962632 0.9999999999962212\n",
      "0.633 0.9999999999958364 0.9999999999960496\n",
      "0.634 0.9999999999942062 0.999999999995798\n",
      "0.635 0.9999999999822415 0.9999999999930704\n",
      "0.636 4.593275777604983e-16 1.0\n",
      "0.637 1.2774853073518482e-20 1.0\n",
      "0.638 3.4171702123976816e-22 1.0\n",
      "0.639 1.9369687687162845e-22 1.0\n",
      "0.64 1.6551360443608596e-22 1.0\n",
      "0.641 1.4591453053568685e-22 1.0\n",
      "0.642 1.289480740752783e-22 1.0\n",
      "0.643 1.140836562170655e-22 1.0\n",
      "0.644 1.0104755554647985e-22 1.0\n",
      "0.645 8.960806536210914e-23 1.0\n",
      "0.646 7.956611830893266e-23 1.0\n",
      "0.647 7.075156425781437e-23 1.0\n",
      "0.648 6.301953649160321e-23 1.0\n",
      "0.649 5.62470730702805e-23 1.0\n",
      "0.65 5.033074389772516e-23 1.0\n",
      "0.651 4.5192352853689015e-23 1.0\n",
      "0.652 1.0 1.564035464567951e-23\n",
      "0.653 1.067144882335342e-72 2.2343413587791914e-89\n",
      "0.654 2.814120692842733e-150 2.919160443201478e-100\n",
      "0.655 1.072739052051753e-166 4.14522405210564e-101\n",
      "0.656 9.414540235988427e-162 1.3624610377002243e-100\n",
      "0.657 8.27886626026547e-145 5.616536780482039e-100\n",
      "0.658 4.376371250770654e-115 2.1817308297687024e-99\n",
      "0.659 1.5448807510833662e-91 8.064217090834312e-99\n",
      "0.66 4.1422188452548017e-82 3.256374527070503e-98\n",
      "0.661 1.0774881850715037e-79 1.4321654250767487e-97\n",
      "0.662 1.7318567407542404e-79 6.554525353510848e-97\n",
      "0.663 6.862508958501786e-80 3.0473642841869198e-96\n",
      "0.664 1.8642503386049054e-80 1.4264343924795098e-95\n",
      "0.665 4.550907513941877e-81 6.70180426264376e-95\n",
      "0.666 1.0713789205152265e-81 3.153728949979686e-94\n",
      "0.667 2.479575367567607e-82 1.458951887779763e-93\n",
      "0.668 5.680175868992424e-83 4.790504425931101e-93\n",
      "0.669 4.173600644445388e-84 4.541146725472845e-95\n",
      "0.67 1.4893417344531018e-178 3.051366480369061e-134\n",
      "0.671 9.11536398226292e-180 2.5987432354182934e-184\n",
      "0.672 4.734023250297022e-181 1.987935898079356e-189\n",
      "0.673 2.5474476234502488e-182 1.6549082700898985e-188\n",
      "0.674 1.3672489979460474e-183 3.074132625299637e-187\n",
      "0.675 7.280224529469281e-185 5.9084234461262484e-186\n",
      "0.676 3.8451174555108815e-186 1.1274479670136283e-184\n",
      "0.677 2.0217435046912828e-187 2.1307156019159256e-183\n",
      "0.678 1.1276280969565388e-188 3.989566504930858e-182\n",
      "0.679 2.167209596500146e-189 7.457445937713394e-181\n",
      "0.68 2.997438089962806e-181 1.4584665714385428e-179\n",
      "0.681 1.1612052653265095e-125 2.2780718052161033e-178\n",
      "0.682 2.3945796914425903e-96 2.7547200403365007e-134\n",
      "0.683 3.130465383367501e-95 1.1875296541515849e-88\n",
      "0.684 9.832822705927655e-96 5.4729359764612575e-98\n",
      "0.685 2.062374402177819e-96 2.9311146546210375e-135\n",
      "0.686 2.5246659863853353e-97 2.866622466634493e-165\n",
      "0.687 2.8247853550741924e-98 1.4455954610797187e-170\n",
      "0.688 3.2280763030810227e-99 3.2139149533651816e-170\n",
      "0.689 3.6751086986894764e-100 3.817881384144597e-169\n",
      "0.69 4.133691802962049e-101 5.516217657179953e-168\n",
      "0.691 4.586522928168553e-102 8.145481501099281e-167\n",
      "0.692 5.019005080790363e-103 1.2055505693173265e-165\n",
      "0.693 5.416807856116089e-104 1.7838295603016086e-164\n",
      "0.694 5.766040905609735e-105 2.6377179479445793e-163\n",
      "0.695 6.05395788328816e-106 3.8968971030051336e-162\n",
      "0.696 6.269716589688601e-107 5.751011572341055e-161\n",
      "0.697 6.405057958397944e-108 8.476645706163356e-160\n",
      "0.698 6.454832618220384e-109 1.2476064711438014e-158\n",
      "0.699 6.417326324981782e-110 1.8332586204222136e-157\n",
      "0.7 6.2943553398536075e-111 2.6889363650606115e-156\n",
      "0.701 6.091124616585662e-112 3.936094643020259e-155\n",
      "0.702 5.815863909137101e-113 5.749045042386875e-154\n",
      "0.703 5.4792771055528325e-114 8.376978780297842e-153\n",
      "0.704 5.093855917014796e-115 1.2174647625641631e-151\n",
      "0.705 4.673118830737438e-116 1.7644843904100548e-150\n",
      "0.706 4.2308391433308575e-117 2.549683244317571e-149\n",
      "0.707 3.7803220557396253e-118 3.6726164673000354e-148\n",
      "0.708 3.333781197882517e-119 5.272288983262831e-147\n",
      "0.709 2.901851172942952e-120 7.541710475259585e-146\n",
      "0.71 2.4932567553582963e-121 1.0747306984120573e-144\n",
      "0.711 2.1146432712366656e-122 1.5254575294276724e-143\n",
      "0.712 1.7705582401388153e-123 2.1561658540815253e-142\n",
      "0.713 1.4635629248764457e-124 3.0342829657701755e-141\n",
      "0.714 1.194444816284521e-125 4.2504170621344625e-140\n",
      "0.715 9.624984894866815e-127 5.925399418254964e-139\n",
      "0.716 7.658424020507445e-128 8.219071884012864e-138\n",
      "0.717 6.017423744353495e-129 1.134109057790768e-136\n",
      "0.718 4.669177809251116e-130 1.5563990549065364e-135\n",
      "0.719 3.5781290405195336e-131 2.1238692732793198e-134\n",
      "0.72 2.7082255868112247e-132 2.881252042262149e-133\n",
      "0.721 2.0246723744449293e-133 3.8849613294966245e-132\n",
      "0.722 1.4951815759293004e-134 5.20533685858783e-131\n",
      "0.723 1.0907642657180529e-135 6.92901895511662e-130\n",
      "0.724 7.861302834499083e-137 9.16133743464798e-129\n",
      "0.725 5.597756939717628e-138 1.2028543662492744e-127\n",
      "0.726 3.9383926296810776e-139 1.5679652854135244e-126\n",
      "0.727 2.7380373933680734e-140 2.028759718019854e-125\n",
      "0.728 1.881071982687077e-141 2.6049324955942305e-124\n",
      "0.729 1.2771672321198708e-142 3.318442530734007e-123\n",
      "0.73 8.570327651614011e-144 4.1931821935325445e-122\n",
      "0.731 5.68441451333296e-145 5.254407681495217e-121\n",
      "0.732 3.7268714814231773e-146 6.527888897683701e-120\n",
      "0.733 2.415491553525752e-147 8.038747873221511e-119\n",
      "0.734 1.547752396789888e-148 9.80997251645481e-118\n",
      "0.735 9.80539491336276e-150 1.1860618050140512e-116\n",
      "0.736 6.142278230847775e-151 1.420374169119713e-115\n",
      "0.737 3.804768025106448e-152 1.6844155595105573e-114\n",
      "0.738 2.3307466004404765e-153 1.9776126139636938e-113\n",
      "0.739 1.4120964275136164e-154 2.2981190130939856e-112\n",
      "0.74 8.461954273791352e-156 2.6426295050948048e-111\n",
      "0.741 5.0159014209987246e-157 3.006249465956185e-110\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.742 2.941268359243698e-158 3.3824436516679896e-109\n",
      "0.743 1.706331311586436e-159 3.763085840023667e-108\n",
      "0.744 9.79425037671324e-161 4.138626210068652e-107\n",
      "0.745 5.562815270914942e-162 4.498385462067287e-106\n",
      "0.746 3.126587588396221e-163 4.8309741484945605e-105\n",
      "0.747 1.739151415695481e-164 5.124823366847573e-104\n",
      "0.748 9.575116152069872e-166 5.368801462110696e-103\n",
      "0.749 5.219694659592885e-167 5.552894222438565e-102\n",
      "0.75 2.824656617371461e-168 5.6690392938690166e-101\n",
      "0.751 1.5571673751664433e-169 5.713093116681252e-100\n",
      "0.752 1.1268359438288556e-170 5.69446984784275e-99\n",
      "0.753 1.1903443243769065e-170 5.682603708772172e-98\n",
      "0.754 1.7104875224242205e-161 5.831504430020362e-97\n",
      "0.755 1.0487863863346038e-128 5.199564867761641e-96\n",
      "0.756 3.6594475303958057e-110 4.269530868782169e-95\n",
      "0.757 4.160803503828515e-108 4.158917321631731e-94\n",
      "0.758 8.014144827736375e-109 4.2494745594420784e-93\n",
      "0.759 7.356203242012786e-110 4.356698626016387e-92\n",
      "0.76 6.139782990467217e-111 4.4479471655196347e-91\n",
      "0.761 5.003845965650232e-112 4.516162393822012e-90\n",
      "0.762 4.0129451428316134e-113 4.558327057533589e-89\n",
      "0.763 3.170044429315986e-114 4.572328630914754e-88\n",
      "0.764 2.467097379454766e-115 4.556606161904884e-87\n",
      "0.765 1.8917390966358223e-116 4.510176432252542e-86\n",
      "0.766 1.4292925602990842e-117 4.4327006792822023e-85\n",
      "0.767 1.0641355258163172e-118 4.324539145562364e-84\n",
      "0.768 7.807647086667008e-120 4.186782159871473e-83\n",
      "0.769 5.645766874531426e-121 4.0212529319602653e-82\n",
      "0.77 4.023814650452289e-122 3.8304793396801535e-81\n",
      "0.771 2.8268228766645148e-123 3.617633798578081e-80\n",
      "0.772 1.957666894128035e-124 3.386442284669248e-79\n",
      "0.773 1.336574457476584e-125 3.141065664258412e-78\n",
      "0.774 8.99698301485744e-127 2.8859585114206633e-77\n",
      "0.775 5.971533600461424e-128 2.6257123780393797e-76\n",
      "0.776 3.90837824061417e-129 2.364891846093148e-75\n",
      "0.777 2.522703152454687e-130 2.1078724793235658e-74\n",
      "0.778 1.6059511964159837e-131 1.858689894311275e-73\n",
      "0.779 1.0084017419846939e-132 1.620908541718036e-72\n",
      "0.78 6.246100282925514e-134 1.3975174545956984e-71\n",
      "0.781 3.816789110754413e-135 1.1908582842459645e-70\n",
      "0.782 2.301132389470199e-136 1.0025885750551281e-69\n",
      "0.783 1.3689270932424723e-137 8.33680648155969e-69\n",
      "0.784 8.03629765110166e-139 6.844539161273809e-68\n",
      "0.785 4.655979582977949e-140 5.546361792926295e-67\n",
      "0.786 2.662493326065715e-141 4.4344766878294264e-66\n",
      "0.787 1.5029070453387853e-142 3.4970045352702624e-65\n",
      "0.788 8.375027632015841e-144 2.7190539381208977e-64\n",
      "0.789 4.607825239243886e-145 2.083790960034809e-63\n",
      "0.79 2.5032668350130277e-146 1.5734421667168192e-62\n",
      "0.791 1.342969504866906e-147 1.170178320736656e-61\n",
      "0.792 7.1157417081875655e-149 8.568424319144413e-61\n",
      "0.793 3.724063597892588e-150 6.1750327138458e-60\n",
      "0.794 1.9253316963264262e-151 4.378318632470396e-59\n",
      "0.795 9.834122675390633e-153 3.053123695358414e-58\n",
      "0.796 4.9632073940654476e-154 2.0930918650637348e-57\n",
      "0.797 2.4755451815774913e-155 1.4101855124297708e-56\n",
      "0.798 1.221051837643216e-156 9.33356567787754e-56\n",
      "0.799 5.974482723599692e-158 6.066782654492473e-55\n",
      "0.8 2.9578830044247104e-159 3.872163042620093e-54\n",
      "0.801 1.6719473674186456e-160 2.4287958133897303e-53\n",
      "0.802 2.219060984717137e-161 1.5040386737263044e-52\n",
      "0.803 3.5227253672575617e-160 9.327706550345068e-52\n",
      "0.804 1.088806142713665e-150 5.813558840079245e-51\n",
      "0.805 1.5335738092757246e-131 3.369311576716455e-50\n",
      "0.806 4.074135203257399e-121 2.019284939931644e-49\n",
      "0.807 2.054126858716131e-119 1.3562128795273326e-48\n",
      "0.808 4.563720514946225e-120 9.463996994980156e-48\n",
      "0.809 3.4833852325538766e-121 6.605117737668959e-47\n",
      "0.81 2.1531558882154666e-122 4.562561273313453e-46\n",
      "0.811 1.2629410696152245e-123 3.11076208302706e-45\n",
      "0.812 7.240101600831304e-125 2.0914241818171722e-44\n",
      "0.813 4.080026445436626e-126 1.3857793026726539e-43\n",
      "0.814 2.2627038965841954e-127 9.04520453927207e-43\n",
      "0.815 1.235342616188626e-128 5.813223262057008e-42\n",
      "0.816 6.640695654748604e-130 3.676982703918999e-41\n",
      "0.817 3.515304377402261e-131 2.287926790438263e-40\n",
      "0.818 1.8326944410441656e-132 1.3998018025653596e-39\n",
      "0.819 9.41130690479949e-134 8.417064731705065e-39\n",
      "0.82 4.761003485214078e-135 4.971851240754993e-38\n",
      "0.821 2.372972964617769e-136 2.883569303419956e-37\n",
      "0.822 1.1654428332011146e-137 1.641295380880778e-36\n",
      "0.823 5.6409514961514016e-139 9.163771635817133e-36\n",
      "0.824 2.6911470226127723e-140 5.016233880081515e-35\n",
      "0.825 1.2656329864124295e-141 2.6907907321205323e-34\n",
      "0.826 5.868488710117157e-143 1.4137124013539883e-33\n",
      "0.827 2.6832244833740764e-144 7.271086727018214e-33\n",
      "0.828 1.2099456053829085e-145 3.659068580183876e-32\n",
      "0.829 5.381736795199666e-147 1.800729076426005e-31\n",
      "0.83 2.3616189185451115e-148 8.661725842055877e-31\n",
      "0.831 1.0227442182878672e-149 4.070138640149041e-30\n",
      "0.832 4.3749873381227604e-151 1.867391521275218e-29\n",
      "0.833 1.8540827925607912e-152 8.361228438710299e-29\n",
      "0.834 7.887288091928283e-154 3.6522111031390742e-28\n",
      "0.835 3.550474331196289e-155 1.5564099145425914e-27\n",
      "0.836 2.087769022091744e-156 6.479910747865313e-27\n",
      "0.837 3.557859100600859e-157 2.647884775659651e-26\n",
      "0.838 2.491790729881402e-156 1.0723648610525651e-25\n",
      "0.839 2.652483948526495e-151 4.330394922262795e-25\n",
      "0.84 1.7351026091455853e-141 1.722930375677928e-24\n",
      "0.841 2.270250845523892e-133 7.001598144067198e-24\n",
      "0.842 2.1440962737710376e-130 3.0595502916537734e-23\n",
      "0.843 2.7053573553907955e-130 1.3979425752291713e-22\n",
      "0.844 3.3252135114306103e-131 6.4285846389472245e-22\n",
      "0.845 1.9791487133830216e-132 2.919710793956908e-21\n",
      "0.846 9.364557935407295e-134 1.2998835046464993e-20\n",
      "0.847 4.0844452149002466e-135 5.655658657962607e-20\n",
      "0.848 1.717294735792824e-136 2.401205348846921e-19\n",
      "0.849 7.05785726243956e-138 9.938641340018487e-19\n",
      "0.85 2.848229847341816e-139 4.007169003538129e-18\n",
      "0.851 1.1305779464384793e-140 1.5727035187270765e-17\n",
      "0.852 4.416837344423314e-142 6.004085653884537e-17\n",
      "0.853 1.698955054030663e-143 2.2280752812565615e-16\n",
      "0.854 6.436747850539977e-145 8.031307177393243e-16\n",
      "0.855 2.4032219259500954e-146 2.8099925786165278e-15\n",
      "0.856 8.851417463221996e-148 9.536254108873953e-15\n",
      "0.857 3.2263501637859224e-149 3.136939840050491e-14\n",
      "0.858 1.1741350965830406e-150 9.996020999160981e-14\n",
      "0.859 4.375887892806286e-152 3.084369638646113e-13\n",
      "0.86 1.792386609026747e-153 9.216288775372028e-13\n",
      "0.861 9.73137733565129e-155 2.6696838254796272e-12\n",
      "0.862 1.111937707564469e-155 7.518347106291105e-12\n",
      "0.863 7.280783533500359e-156 2.069529679732641e-11\n",
      "0.864 1.405535201351083e-154 5.608152201452319e-11\n",
      "0.865 2.554918787347097e-151 1.5067872673625288e-10\n",
      "0.866 6.699809606223467e-147 4.058191497738457e-10\n",
      "0.867 3.0361488589486554e-143 1.1165972638907667e-09\n",
      "0.868 2.1769833831478417e-141 3.1668419505815365e-09\n",
      "0.869 4.691799062972037e-141 9.147110796297384e-09\n",
      "0.87 1.260780895098632e-141 2.6393017626002193e-08\n",
      "0.871 1.158737653061916e-142 7.492673509145483e-08\n",
      "0.872 6.268626382736063e-144 2.072950729714153e-07\n",
      "0.873 2.6071690889699376e-145 5.557910510345241e-07\n",
      "0.874 9.505645078184436e-147 1.439290717599437e-06\n",
      "0.875 3.263033434614661e-148 3.5924318132562328e-06\n",
      "0.876 1.111515022464206e-149 8.630870552464731e-06\n",
      "0.877 3.994801602912609e-151 1.994497012587305e-05\n",
      "0.878 1.667679131872374e-152 4.432939913288355e-05\n",
      "0.879 9.482009923903457e-154 9.483034931038431e-05\n",
      "0.88 9.370600821184693e-155 0.0001955941696383601\n",
      "0.881 2.2026687224838206e-155 0.0003900976086025503\n",
      "0.882 1.636086627929829e-155 0.0007553604211998684\n",
      "0.883 4.069600361662819e-155 0.00142720887761929\n",
      "0.884 2.4119303570491295e-154 0.0026461459524322445\n",
      "0.885 1.7333764582805617e-153 0.004838449838453642\n",
      "0.886 7.522796055971833e-153 0.008745070882265912\n",
      "0.887 1.278199181705326e-152 0.01559091242164411\n",
      "0.888 7.528487726376595e-153 0.02724101558089643\n",
      "0.889 1.651228371398181e-153 0.046211230751959056\n",
      "0.89 1.5460077341374374e-154 0.07531285844084956\n",
      "0.891 7.058968649616764e-156 0.11673315125950519\n",
      "0.892 1.7602554314271804e-157 0.17067753555478776\n",
      "0.893 2.6398844927430547e-159 0.23428858344265854\n",
      "0.894 2.561661740762245e-161 0.3017940392071866\n",
      "0.895 1.638340310598302e-163 0.3660580574035866\n",
      "0.896 6.258549259816582e-166 0.42048987065671345\n",
      "0.897 1.014749452389306e-168 0.4600006195722781\n",
      "0.898 2.77168378237113e-172 0.4804776164808225\n",
      "0.899 8.539329748061613e-178 0.47667886823162997\n",
      "0.9 5.620779218201821e-200 0.4366218909820941\n",
      "0.901 0.0 0.14429317829413654\n",
      "0.902 0.0 4.772535557641136e-05\n",
      "0.903 0.0 2.277927071861254e-09\n",
      "0.904 0.0 1.0872006795749796e-13\n",
      "0.905 0.0 5.188951605052739e-18\n",
      "0.906 0.0 2.4765638272206456e-22\n",
      "0.907 0.0 1.1820053176650186e-26\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.908 0.0 5.641431711301183e-31\n",
      "0.909 0.0 2.6925218759543806e-35\n",
      "0.91 0.0 1.2850769846237973e-39\n",
      "0.911 0.0 6.133368390287574e-44\n",
      "0.912 0.0 2.9273116133070994e-48\n",
      "0.913 0.0 1.3971365709908435e-52\n",
      "0.914 0.0 6.66820228200216e-57\n",
      "0.915 0.0 3.182575175318324e-61\n",
      "0.916 0.0 1.5189678294394795e-65\n",
      "0.917 0.0 7.249674052514533e-70\n",
      "0.918 0.0 3.4600978933957847e-74\n",
      "0.919 0.0 1.6514228564163623e-78\n",
      "0.92 0.0 7.881850556589989e-83\n",
      "0.921 0.0 3.7618207810965953e-87\n",
      "0.922 0.0 1.7954280517603467e-91\n",
      "0.923 0.0 8.569153281425261e-96\n",
      "0.924 0.0 4.089854109645285e-100\n",
      "0.925 0.0 1.951990597999442e-104\n",
      "0.926 0.0 9.316389270935517e-109\n",
      "0.927 0.0 4.4464921673564854e-113\n",
      "0.928 0.0 2.1222055046689615e-117\n",
      "0.929 0.0 1.0128784746543827e-121\n",
      "0.93 0.0 4.8342293060749256e-126\n",
      "0.931 0.0 2.307263266869723e-130\n",
      "0.932 0.0 1.1012021659695158e-134\n",
      "0.933 0.0 5.2557773867845895e-139\n",
      "0.934 0.0 2.508458191697507e-143\n",
      "0.935 0.0 1.1972277431905766e-147\n",
      "0.936 0.0 5.714084746597101e-152\n",
      "0.937 0.0 2.7271974506949967e-156\n",
      "0.938 0.0 1.3016268160009255e-160\n",
      "0.939 0.0 6.212356819642852e-165\n",
      "0.94 0.0 2.9650109217251024e-169\n",
      "0.941 0.0 1.4151295589078134e-173\n",
      "0.942 0.0 6.754078556076614e-178\n",
      "0.943 0.0 3.223561889045756e-182\n",
      "0.944 0.0 1.5385298181316946e-186\n",
      "0.945 0.0 7.343038796059472e-191\n",
      "0.946 0.0 3.504658676421051e-195\n",
      "0.947 0.0 1.672690663816531e-199\n",
      "0.948 0.0 7.983356769213345e-204\n",
      "0.949 0.0 3.8102672946790864e-208\n",
      "0.95 0.0 1.818550426418038e-212\n",
      "0.951 0.0 8.679510904769616e-217\n",
      "0.952 0.0 4.142525192134237e-221\n",
      "0.953 0.0 1.9771292594414274e-225\n",
      "0.954 0.0 9.43637015403672e-230\n",
      "0.955 0.0 4.503756204039049e-234\n",
      "0.956 0.0 2.1495362744703992e-238\n",
      "0.957 0.0 1.0259228044179555e-242\n",
      "0.958 0.0 4.8964868056669637e-247\n",
      "0.959 0.0 2.3369772983732255e-251\n",
      "0.96 0.0 1.1153839701538126e-255\n",
      "0.961 0.0 5.3234637826451355e-260\n",
      "0.962 0.0 2.540763306939562e-264\n",
      "0.963 0.0 1.21264621033678e-268\n",
      "0.964 0.0 5.787673442178817e-273\n",
      "0.965 0.0 2.762319593940798e-277\n",
      "0.966 0.0 1.3183897839605579e-281\n",
      "0.967 0.0 6.292362499490034e-286\n",
      "0.968 0.0 3.0031957397330673e-290\n",
      "0.969 0.0 1.4333542690655271e-294\n",
      "0.97 0.0 6.841060785569311e-299\n",
      "0.971 0.0 3.2650764491312215e-303\n",
      "0.972 0.0 1.5583437353981868e-307\n",
      "0.973 0.0 7.43760593508e-312\n",
      "0.974 0.0 3.54979334e-316\n",
      "0.975 0.0 1.694e-320\n",
      "0.976 0.0 0.0\n",
      "0.977 0.0 0.0\n",
      "0.978 0.0 0.0\n",
      "0.979 0.0 0.0\n",
      "0.98 0.0 0.0\n",
      "0.981 0.0 0.0\n",
      "0.982 0.0 0.0\n",
      "0.983 0.0 0.0\n",
      "0.984 0.0 0.0\n",
      "0.985 0.0 0.0\n",
      "0.986 0.0 0.0\n",
      "0.987 0.0 0.0\n",
      "0.988 0.0 0.0\n",
      "0.989 0.0 0.0\n",
      "0.99 0.0 0.0\n",
      "0.991 0.0 0.0\n",
      "0.992 0.0 0.0\n",
      "0.993 0.0 0.0\n",
      "0.994 0.0 0.0\n",
      "0.995 0.0 0.0\n",
      "0.996 0.0 0.0\n",
      "0.997 0.0 0.0\n",
      "0.998 0.0 0.0\n",
      "0.999 0.0 0.0\n"
     ]
    }
   ],
   "source": [
    "scale=1000\n",
    "for num in range(1,1001):\n",
    "\n",
    "    if num!=1000:\n",
    "        guessl=.5\n",
    "        guessf=.5\n",
    "        FS=num/scale\n",
    "\n",
    "        mu=0\n",
    "\n",
    "        integralsF=[integral(payoffsF,z,FS) for z in range(N+1)]\n",
    "        integralsL=[integral(payoffsL,z,FS) for z in range(N+1)] \n",
    "\n",
    "        if FS>.999:\n",
    "            FS=.9995\n",
    "\n",
    "        for i in range(200):\n",
    "            [guessl,guessf,payoffL,payoffF]=intermediate_period(FS,payoffsL,payoffsF,[guessl,guessf])\n",
    "            mu=mu+5\n",
    "    #         print(mu)\n",
    "        leader_probs.append(guessl)\n",
    "        follower_probs.append(guessf)\n",
    "        leader_payoffs.append(payoffL)\n",
    "        follower_payoffs.append(payoffF)\n",
    "        print(FS,guessl,guessf)\n",
    "        \n",
    "    else:\n",
    "        leader_payoffs.append(leader_payoffs[999])\n",
    "        follower_payoffs.append(follower_payoffs[999])\n",
    "        leader_probs.append(leader_probs[999])\n",
    "        follower_probs.append(follower_probs[999])\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 170,
   "metadata": {},
   "outputs": [],
   "source": [
    "with open('Alternative_Follower_Prob_Period_%s_%s_%s_%s.pkl'%(period,N,v,c), 'wb') as f:\n",
    "    pickle.dump(follower_probs,f)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 171,
   "metadata": {},
   "outputs": [],
   "source": [
    "with open('Alternative_Leader_Prob_Period_%s_%s_%s_%s.pkl'%(period,N,v,c), 'wb') as f:\n",
    "    pickle.dump(leader_probs,f)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 172,
   "metadata": {},
   "outputs": [],
   "source": [
    "with open('Alternative_Follower_Payoffs_Period_%s_%s_%s_%s.pkl'%(period,N,v,c), 'wb') as f:\n",
    "    pickle.dump(follower_payoffs,f)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 173,
   "metadata": {},
   "outputs": [],
   "source": [
    "with open('Alternative_Leader_Payoffs_Period_%s_%s_%s_%s.pkl'%(period,N,v,c), 'wb') as f:\n",
    "    pickle.dump(leader_payoffs,f)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
